<?php
// +----------------------------------------------------------------------
// | 云游线路产品开发
// +----------------------------------------------------------------------
// | Author: TongBC <50249101@qq.com>
// +----------------------------------------------------------------------
// | Date  : 2015/02/03
// +----------------------------------------------------------------------
// | table : pft_scenic
// +----------------------------------------------------------------------
use \pft\Prod\Product;
include 'common/header.html';
include 'common/left.html';
include 'common/autoload.php';
include 'common/prodField.php';
include_once '/var/www/html/new/d/module/db/db.class.php';
// 远端服务器配置信息
$dbConf = include '/var/www/html/new/d/module/db/db.conf.php';
use \PFT\Db;
Db::Conf($dbConf['remote_1']);

$ptype = strtoupper($_GET['type']);
$saveBtn = '<input class="sure_blue" id="saveProduct" data-wrap="ticketBox" type="submit" value="保存，返回列表">';

$apply_did = $_SESSION['sid'];// 供应商ID

// 身份认证
if($_SESSION['dtype']==6 && $_SESSION['sdtype']!=0) {
    exit('您的上级不是供应商身份，无法发布产品。');
}elseif($_SESSION['dtype']!=0 && $_SESSION['dtype']!=9) {
    exit('您不是供应商身份，无法发布产品。');
}

// 获取子景点信息
$cid = $_REQUEST['id'] + 0;
if($cid>0){
	$scenic = array();
	$sql="select * from pft_scenic where id=$cid limit 1";
	// $GLOBALS['le']->query($sql);
	// $scenic = $GLOBALS['le']->fetch_assoc();
	$scenic = Db::fetch($sql);
}
//if($_GET('s')){print_r($scenic);}
// print_r($scenic);

$thumb = $scenic['thumb_path'] ? $scenic['thumb_path']:'http://www.12301.cc/prodimgs/123642/20140916/14108485792643.jpg';
$video = $scenic['video_path'] ? $scenic['video_path']:'';
$voice = $scenic['intro_voice_path'] ? $scenic['intro_voice_path']:'';
$panorama = $scenic['degree_path'] ? $scenic['degree_path']:'';


// 父景点ID 即 uu_land 表 id
$parent_id = $_REQUEST['lid'];
// if(empty($parent_id)) exit('非法访问');

$page_title = "产品发布 - ";
// <iframe src="http://121.41.120.34/pft/tour/prod_edits_child.php?sid=1433" style="border:none;width:790px;min-height:730px;overflow:hidden;"/></iframe>
?>
<!-- <link rel="stylesheet" href="css/aliceui.min.css"/> -->
<link rel="stylesheet" href="css/resetui.css"/>
<link rel="stylesheet" href="css/prod_store.css"/>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DE946147d82abf8082f7e80868ea8afb"></script>
<div class="wrapper">
<h3 class="mc_title">
	<span class="mctit_1"><span class="mctit_2">子景点发布</span></span>
</h3>
<style>
.prod_child .prod_child_list{ display:block;width:800px;position: relative;}
.prod_child .prod_child_list .con{ padding:10px; padding-left:35px;  background:#fafafa; }
.prod_child .prod_child_list .con_sure{ padding:10px; padding-left:80px;  background:#fafafa;height:50px;line-height:50px; }
.prod_child .prod_child_list .con_textarea{ height:300px;padding:10px; padding-left:35px;  background:#fafafa; }
.prod_child .prod_child_list .con_img{ height:170px;padding:10px; padding-left:35px;  background:#fafafa; }
.prod_child .prod_child_list .con_img span.lt {width: 85px;display: inline-block;float: left;text-align: left;margin-top: 10px;}
.prod_child .prod_child_list .con span.lt {width: 85px;display: inline-block;float: left;text-align: left;margin-top: 10px;}
.prod_child .prod_child_list .con_textarea span.lt {width: 85px;display: inline-block;float: left;text-align: left;margin-top: 10px;}
.prod_child .textInp{ height:26px; line-height:26px; border:1px solid #e5e5e5; padding:3px 5px; background:#fcfcfc}
.prod_child .prod_child_list .con .textInp.w400{ width:400px; text-align:left; margin-left:16px;}
.prod_child .prod_child_list .con .textInp.w290{ width:290px; text-align:left; margin-left:16px;}
.prod_child .prod_child_list .con .spc_sel{  margin-top:16px;}
.prod_child .prod_child_list .con #result_ab {height: 15px;margin-top: 14px;position: absolute;}
.prod_child .prod_child_list .con .d_province{width: 90px;height: 35px;line-height: 35px;margin-left: 16px;border: 1px solid #e5e5e5;} 
.prod_child .prod_child_list .con .d_city{width: 90px;height: 35px;line-height: 35px;margin-left: 16px;border: 1px solid #e5e5e5;} 
.prod_child .prod_child_list .con select{ width:413px;height:35px;line-height:35px;margin-left: 16px; border:1px solid #e5e5e5; }
.prod_child .prod_child_list .con_textarea .detailInfo{ position: absolute;left: 120px;width:642px;height:260px;line-height:35px;margin-left: 16px; border:0px; }
.prod_child .prod_child_list .con_textarea .prod_music{left: 120px;background-color:#fffcdb;width:631px;padding-left:10px;height:50px;line-height:50px;border: 1px solid #e5e5e5;radius:1px; }
.prod_child .prod_child_list .con_img .prod_upimg{ position: absolute;left: 120px;width:642px;height:260px;line-height:35px;margin-left: 16px; border:0px; }
.prod_child .prod_child_list .con_img .produploadImg {position: absolute;right: 50px;width: 340px;top: 0px;}
.prod_child .prod_child_list .con .prod_deo{ position:relative;left:16px;width:650px;height:30px;line-height:30px;margin-left: 30px; border:0px; }
.prod_child .prod_child_list .con_sure .sure_blue{width: 180px;height: 30px;float: left;line-height: 30px;border: 0;font-size: 1.4em;background-color: #00a0e9;text-align: center;font-weight: normal;color: #FFF;margin-top: 10px;margin-right:10px;cursor: pointer;margin-left:55px;}
.cb {width: 16px;height: 16px;top:7px;margin-right:5px;border: 2px solid #B2ADAD;display: inline-block;cursor: pointer;color: #9b0e0e;-webkit-border-radius: 14px;border-radius: 14px;position: relative;}
.ct {background: #22c3aa;width: 12px;height: 12px;margin-top: 2px;margin-left: 2px;-webkit-border-radius: 14px;border-radius: 14px;position: absolute;}
#imgup,#imgup1,#imgup2,#imgup3{border:1px solid #E1E1E1;background-color:white;}
.upload_btn{display: inline-block;text-align: center;text-decoration: none;vertical-align: middle;cursor: pointer;font-size: 14px;
border-radius: 2px;padding: 0 20px;background-image: none;border: 1px solid #afafaf;background-color: #f3f3f3;color: #777;line-height: 24px;
height: 24px;padding: 0 12px;font-size: 12px;}
</style>
<div id="sceneryBox" class="ui-box mt10 fn-clear"> 
<?if($isedit){?>
<div class="ui-box-head">
	<h3 class="ui-box-head-title"><?=$ProdTypes[$ptype]?>信息</h3>
	<span class="ui-box-head-text"></span>
	<a href="#" class="ui-box-head-more"></a>
</div>
<?}?>
<div class="prod_child">
	<div class="prod_child_list">
	<form name="mainForm" id="mainForm" class="ui-form" method="post" action="http://121.41.120.34/pft/tour/upload.php" enctype="multipart/form-data" target="hideFrame">
	<input type="hidden" name="lastid" value="<?=$scenic['id']?>"/>
	<input type="hidden" name="parent_id" value="<?=$parent_id?>"/>
	<input type="hidden" name="applydid" value="<?=$apply_did?>"/>
	<input type="hidden" name="action" value="scenic"/>
	<input type="hidden" name="nf" value="<?=$_REQUEST['nf']?>"/>
	<input type="hidden" name="upload_mth" id="upload_mth" value="1"/> 
	<input type="hidden" name="ac" value="<?=$_SESSION['saccount']?>"/> 

	<fieldset>
		<div class="con">
			<span class="lt">导览点名称：</span>
			<input title="请填写<?=$FieldList[$ptype]['title']?>" class="textInp w400" data-required="2" id="mainTitle" name="mainTitle" type="text" autofocus value="<?=($_REQUEST['title']) ? '':$scenic['scenic_name']?>" />
			<span class="ui-form-other ui-form-explain"><input id="Certainly" checked="checked" class="spc_sel" type="checkbox" name="Certainly" value="1" style="display: none;">必玩景点</span>
		</div>

		<!--显示经纬度-->
		<div id="container" style="position: absolute;margin-top:30px; width: 3px; height: 3px; display:none;top: 50; border: 1px solid gray;overflow:hidden;"></div> 
		
		<div class="con">
			<span class="lt">归属景点：</span>
			<select name="attribution" size="1" class="dis_select"  >
				<option value="1" selected="selected">1</option>
				<option value="2">2</option>
				<option value="3">3</option>
			</select>
		</div>
		
		<div class="con">
			<span class="lt">所在地区：</span>
			<input type="hidden" value="<?=$scenic['province']?>|<?=$scenic['city']?>" name="area"/>
			<input type="hidden"  id="ccid" />
			<span id="area"></span>
			<input type="hidden" name="child_place_tude" id="result_b"/>
			<input type="hidden"   id="ccid2" value="" />
			<input class="textInp w290" data-required="1" id="text_b"  name="detail_address" onBlur="searchByStationName();" type="text" value="<?=$scenic['detail_addr']?>">
			<span class="ui-form-other ui-form-explain" ></span>
			<input type="text" id="result_ab" style="border-style:none" value="<? if($scenic['lng']) echo $scenic['lng'].','.$scenic['lat'];?>" /> 
		</div>
		<div class="con">
			<span class="lt">看点：</span>
			<input title="请填写<?=$FieldList[$ptype]['title']?>" class="textInp w400" data-required="2" id="mainTitle" name="aspect" type="text" autofocus value="" />
			<span class="ui-form-other ui-form-explain">填写1到3个短语或词语，以空格隔开。</span>
		</div>
		
		<div class="con">
			<span class="lt">建议游玩时长：</span>
			<input title="请填写<?=$FieldList[$ptype]['title']?>" class="textInp w400" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="10" size="14" data-required="2" id="mainTitle" name="play_time" type="text" autofocus value="" />
			<span class="ui-form-other ui-form-explain">分钟</span>
		</div>
		
		<div class="con_textarea">
			<span class="lt">导览词:</span>
			<div class="detailInfo">
				<textarea id="detailInfo" name="detailInfo" data-required="2" title="导游词" ><?=$scenic['tour_guide']?></textarea>
				<div class="prod_music">
					语音:
					<a class="lnk_prv" style="display:none" target="_blank" title="语音介绍" href="<?=$voice?>">
						<input type="hidden" name="upfile_music_v" class="thumb_img" value="<?=$voice?>"/>
						<img style="width:240px;height:160px;" src="<?=$voice?>" class="preview" />
					</a>
					<input type="file" name="upfile_music" id="imgup1"/>
					<input type="button" id="BtnUpload1" value="上传" class="upload_btn"/>
					<?if($voice!=''):?>
					<span style="color:blue;">已上传</span>
					<?endif;?>
					<i class="ui-form-explain">点击上传小于1M的MP3或aac或者wma格式的音频</i>
					<i class="waitingUpload" class="ui-form-other"></i>
				</div>
			</div>
		</div>
		
		<!--thumb image-->
		<div class="con_img">
			<span class="lt">导览点图片:</span>
			<div class="prod_upimg">
				<a class="lnk_prv" target="_blank" title="点击查看原图" href="<?=$thumb?>">
					<input type="hidden" name="thumb_img" class="thumb_img" value="<?=$thumb?>"/>
					<img style="width:240px;height:160px;" src="<?=$thumb?>" class="preview" />
				</a>
				<div class="produploadImg">
					<p class="title">重新上传缩略图：</p>
					<input type="file" name="upfile" id="imgup"/>
					<input type="button" id="BtnUpload" value="上传" class="upload_btn"/>
					<p class="ui-form-explain">点击上传小于1M的JPG或GIF格式的图片,<br/>建议图片尺寸：宽350像素，高230像素</p>
					<p class="waitingUpload" class="ui-form-other"></p>
				</div>
			</div>
		</div>
		
		
		<div class="con">
			<span class="lt">视频：</span>
			<div class="prod_deo">
				<a class="lnk_prv" style="display:none" target="_blank" title="视频介绍" href="<?=$video?>">
					<input type="hidden" name="upfile_video_v" class="thumb_img" value="<?=$video?>"/>
					<img style="width:240px;height:160px;" src="<?=$video?>" class="preview" />
				</a>
				 <input type="file" name="upfile_video" id="imgup2"/>
				<input type="button" id="BtnUpload2" value="上传" class="upload_btn"/>
				<?if($video!=''):?>
				<span style="color:blue;">已上传</span>
				<?endif;?>
				<i class="ui-form-explain">点击上传小于5M的.mov,.mp4,.avi,.mkv格式的视频</i>
				<i class="waitingUpload" class="ui-form-other"></i>
			</div>
		</div>
		
		<div class="con">
			<span class="lt">360全景：</span>
			<div class="prod_deo">
				<a class="lnk_prv" style="display:none" href="<?=$panorama?>">
					<input type="hidden" name="upfile_allvideo" class="thumb_img" value="<?=$panorama?>"/>
					<img style="width:240px;height:160px;" src="<?=$panorama?>" class="preview" />
				</a>
				<input type="file" name="upfile_allvideo" id="imgup3"/>
				<input type="button" id="BtnUpload3" value="上传" class="upload_btn"/>
				<?if($panorama!=''):?>
				<span style="color:blue;">已上传</span>
				<?endif;?>
				
				<i class="ui-form-explain">点击上传小于3M的360全景文件</i>
				<i class="waitingUpload" class="ui-form-other"></i>
			</div>
		</div> 
		<!--thumb image-->
		<div class="con_sure"><?=$saveBtn?><a href="<?=$_SERVER['HTTP_REFERER']?>">返回列表</a></div>
	</fieldset>
</form>
</div>
</div>
</div>
</div><!--div.wrapper-->
<ul id="mainAreas"></ul>
<iframe src="about:blank" style="display: block;" id="hideFrame" name="hideFrame" frameborder="0"></iframe>
 <script src="http://www.12301.cc/js/getaress.js" type="text/javascript"></script>
<script src="http://www.12301.cc/js/point_c.js" type="text/javascript"></script><!--经纬度-->
<!-- 配置文件 -->
<script type="text/javascript" charset="utf-8" src="ue_126/ueditor_config_mini.js"></script>
<!-- 核心文件 -->
<script type="text/javascript" src="js/easydialog.min.js" ></script>
<script type="text/javascript" src="ue_126/ueditor.all.min.js"></script>
<script type="text/javascript" src="js/prod_pub.js"></script>
<script type="text/javascript" src="js/ceratainly.js"></script>
<script type="text/javascript" src="js/prod_editk_v3_dtdtdt.js?body=1"></script>
</div><!--div.wrapper-->

<script type="text/javascript">  
   jQuery(document).ready(function(){   
    $('#Certainly').betterCheckbox({boxClass: 'cb', tickClass: 'ct'});  

});  
</script>  
<?include('common/footer.html')?>